﻿using AutoMapper;
using Enferno.Public.Web.Components.Server.ViewModels;
using Enferno.Public.Web.Models;

namespace Enferno.Public.Web.Components.Server.Mappers
{
    public class CustomerModelToCustomerViewModelProfile : Profile
    {
        protected override void Configure()
        {
            Mapper.CreateMap<CustomerModel, CustomerViewModel>();
            Mapper.CreateMap<CustomerViewModel, CustomerModel>()
                .ForMember(to => to.Id, opts => opts.Ignore())
                .ForMember(to => to.Code, opts => opts.Ignore());

            Mapper.CreateMap<PersonInformationModel, PersonInformationViewModel>();
            Mapper.CreateMap<PersonInformationViewModel, PersonInformationModel>();
        }
    }
}
